package com.easyweb.session;

 

import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.*;

import javax.persistence.EntityManager;

import com.easyweb.entity.Bayi;
import com.easyweb.entity.Iller;
 
@Name("bayiList")
public class BayiList extends EntityQuery<Bayi> {

	@In EntityManager entityManager;
	private static final String EJBQL = "select bayi from Bayi bayi";
	private List<Bayi> bayiList=null;
	
	private static final String[] RESTRICTIONS = {
			"lower(bayi.binaAdi) like lower(concat(#{bayiList.bayi.binaAdi},'%'))",
			"lower(bayi.binaNo) like lower(concat(#{bayiList.bayi.binaNo},'%'))",
			"lower(bayi.cadde) like lower(concat(#{bayiList.bayi.cadde},'%'))",
			"lower(bayi.daireNo) like lower(concat(#{bayiList.bayi.daireNo},'%'))",
			"lower(bayi.katNo) like lower(concat(#{bayiList.bayi.katNo},'%'))",
			"lower(bayi.postaKodu) like lower(concat(#{bayiList.bayi.postaKodu},'%'))",
			"lower(bayi.sokak) like lower(concat(#{bayiList.bayi.sokak},'%'))",
			"lower(bayi.ticariUnvan) like lower(concat(#{bayiList.bayi.ticariUnvan},'%'))",
			"lower(bayi.unvan) like lower(concat(#{bayiList.bayi.unvan},'%'))", };

	private Bayi bayi = new Bayi();


	public BayiList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}
	
 
	 
	public Bayi getBayi() {
		return bayi;
	}

	public List<Bayi> getBayiList() {
		if (bayiList==null)
			;
		return bayiList;
	}

	public void setBayiList(List<Bayi> bayiList) {
		this.bayiList = bayiList;
	}
}
